package com.kinyx.framework.db.vo;

import java.lang.reflect.Field;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;

/**
 * 映射列信息
 */
@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
@Getter
@ToString(exclude = "field")
public class ColumnInfo {

	/** 字段 */
	private final Field field;
	/** 字段名 */
	private final String fieldName;
	/** 字段类型 */
	private final Class<?> fieldType;

	/** 列名 */
	private final String columnName;

	/** 是否可新增 */
	private Boolean insertable;
	/** 是否可修改 */
	private Boolean updatable;

	void init() {
		this.insertable = MappingHandler.load_column_insertable(this.field);
		this.updatable = MappingHandler.load_column_updatable(this.field);
	}

}
